#include <stdio.h>

typedef struct human {
    int  age;
    char sex;

    void (*set_age)(struct human *p, int age);
    int (*get_age)(struct human *p);

    void (*set_sex)(struct human *p, char sex);
    char (*get_sex)(struct human *p);

} Human;

/* simply demonstrate */
typedef struct human *PstHuman;

void set_age(PstHuman p, int age) { p->age = age; }

int get_age(PstHuman p) { return p->age; }

void set_sex(PstHuman p, char sex) { p->sex = sex; }

char get_sex(PstHuman p) { return p->sex; }

/* simply demonstrate */
typedef struct human *PstHuman;

int main()
{
    Human p;
    p.set_age = set_age;
    p.set_sex = set_sex;
    p.get_age = get_age;
    p.get_sex = get_sex;

    p.set_age(&p, 19);
    p.set_sex(&p, 'M');

    printf("human: {\"age\":%d, \"sex\":\'%c\'}\n", p.get_age(&p),
           p.get_sex(&p));

    return 0;
}
